package cn.sail.controller;

import cn.sail.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
    @Autowired
    private  UserService userService;

    public void login(String userName,String password){
        System.out.printf(userService.login(userName,password).toString());
    }


    public static void main(String[] args) {
        ClassPathXmlApplicationContext classPathXmlApplicationContext =
                new ClassPathXmlApplicationContext("spring-annotationConfig.xml");
        UserController userController = (UserController) classPathXmlApplicationContext.getBean("userController");
        userController.login("yxj","123");
    }


}
